#include "main.h"
sbit PUSH = P3 ^ 5;
sbit PUT = P3 ^ 4;
sbit PULL = P3 ^ 6;

void _74HC595_(unsigned char a)
{
    unsigned char i = 0;
    for(i=0;i<8;i++)
    {
        PUT = a&(0x80>>i);
        PULL = 1;
        PULL = 0;

    }
    
    PUSH = 1;
    PUSH= 0;

//P2=DPL;

}

void LED_init(unsigned char Lie,unsigned char a)
{
    _74HC595_(a);//段选
    P0=~(0x80>>Lie);//位选
    Delay(1);
    P0=0xff;//清屏
}

void main()
{
   //unsigned char i=0;
    PUSH = 0;
    PULL = 0;
     
    
    while (1)
    {
//笑脸，静态图形
    LED_init(0,0x3c);
    LED_init(1,0x42);
    LED_init(2,0xa9);
    LED_init(3,0x85);
    LED_init(4,0x85);
    LED_init(5,0xa9);
    LED_init(6,0x42);
    LED_init(7,0x3c);
   

    }
}

